<?php

namespace Lib\Exception;

use Exception,
    Lib\View\View;

class AppException extends Exception{

    public static $messageTemplate = MESSAGE_NOT_FOUND;
    
    public function __construct($message) {
        $this->message = sprintf(self::$messageTemplate, $message);
    }

    public function __toString() {
        return View::render('Errors/404', 'public', array(
            'error' => $this
        ), true);
    }
}